<template>
	<view v-if="pageShow">
		<!-- 赛事内容 -->
		<view class="mainpadding ffffff">
			<view class="flexbetween">
				<view class="shilitu">
					<image :src="dataAll.ss.image_text" mode=""></image>
				</view>
				<view class="" style="width: 69%;">
					<view class="titletext xiaohei fonweight yhxk">{{dataAll.ss.name}}</view>
					<view class="strongtext xiaohui nofonweight margin_right2 margin_top2">赛事开始时间：{{dataAll.ss.bs_starttime_text}}</view>
					<view class="strongtext xiaohui nofonweight margin_right2 margin_top2">赛事结束时间：{{dataAll.ss.bs_endtime_text}}</view>
				</view>
			</view>
			<view class="margin_top strongtext xiaohui nofonweight margin_top2"><text class="titletext fonweight xiaohei">比赛地址：</text>{{dataAll.ss.cityinfo}}{{dataAll.ss.address}}</view>
		</view>
		<!-- 支付方式 -->
		<view class="ffffff mainpadding margin_top1">
			<view class="flexbetween xiahuaxian">
				<view class="ershiba xiaohei nofonweight">退款金额：</view>
				<view class="ershiba xiaohong nofonweight">{{dataAll.ss.price}}</view>
			</view>
			<!-- <view class="flexbetween margin_top">
				<view class="ershiba xiaohei nofonweight">退款方式：</view>
				<view class="ershiba xiaohei nofonweight">原路退回</view>
			</view> -->
		</view>
		<!--  固定底部-->
		<view class="mainpadding margin_top gudingdb">
			<view class="margin_top2 bigbtn" @click="submit()">确定</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				type: 1,//1赛事详情，2活动详情
				listid: "",
				dataAll:{},
				pageShow:false
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.type = options.type
			this.getDetail()
		},
		methods: {
			getDetail() {
				let url = '/api/user/ssBmDetail'
				if (this.type == 2) {
					url = '/api/user/activityBmDetail'
				}
				httpRequest.request(url, 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			submit(){
				let url = '/api/user/ssBmCancel'
				if (this.type == 2) {
					url = '/api/user/activityBmCancel'
				}
				httpRequest.request(url, 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack({
								delta:2
							})
						},1000)
					}
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	page {
		background-color: #F9F9F9;
	}

	.shilitu {
		width: 200rpx;
		height: 160rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>